// in src/i18nProvider.js
import polyglotI18nProvider from 'ra-i18n-polyglot';
import en from 'ra-language-english';
import zh from 'ra-language-chinese';

const translations = { en, zh };

export const i18nProvider = polyglotI18nProvider(
    locale => translations[locale],
    'zh', // default locale
    [{ locale: 'en', name: 'English' }, { locale: 'zh', name: '中文' }],
);